﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Mall.MCScriptManageServices
{
    public partial class UpdateMember : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string _id = Request["id"] == null ? "0" : Request["id"].ToString();
            string _UserName = Request["UserName"] == null ? "" : Request["UserName"].ToString();
            string _userpwd = Request["userpwd"] == null ? "" : Request["userpwd"].ToString();
            string _Intro = Request["intro"] == null ? "" : Request["intro"].ToString();
            string _userState = Request["userstate"] == null ? "0" : Request["userstate"].ToString();
            string _classid = Request["classid"] == null ? "0" : Request["classid"].ToString();
            string _mobile = Request["mobile"] == null ? "" : Request["mobile"].ToString();
            string _email = Request["email"] == null ? "" : Request["email"].ToString();
            string _address = Request["address"] == null ? "" : Request["address"].ToString();
            string _Phone = Request["phone"] == null ? "" : Request["phone"].ToString();
            string _qq = Request["qq"] == null ? "" : Request["qq"].ToString();
            string _msn = Request["msn"] == null ? "" : Request["msn"].ToString();
            string _sex = Request["sex"] == null ? "0" : Request["sex"].ToString();
            string _birdhday = Request["BirthDay"] == null ? DateTime.MinValue.ToString() : Request["BirthDay"].ToString();
            string _fax = Request["fax"] == null ? "" : Request["fax"].ToString();
            string _zipcode = Request["zipcode"] == null ? "" : Request["zipcode"].ToString();
            string _name = Request["Name"] == null ? "" : Request["name"].ToString();
            MODEL.MMember model = new MODEL.MMember();
            model.Id = Convert.ToInt32(_id);
            model.UserName = _UserName;
            model.UserPwd = _userpwd;
            model.Intro = _Intro;
            model.UserState = Convert.ToInt32(_userState);
            model.ClassId = Convert.ToInt32(_classid);
            model.Mobile = _mobile;
            model.Email = _email;
            model.Address = _address;
            model.Phone = _Phone;
            model.Qq = _qq;
            model.Msn = _msn;
            model.Sex = Convert.ToInt32(_sex);
            model.BirthDay = Convert.ToDateTime(_birdhday);
            model.Fax = _fax;
            model.ZipCode = _zipcode;
            model.Name = _name;
            BLL.Models.MemberModels mom = new BLL.Models.MemberModels();
            bool ret = mom.UpdateMember(model);
            string jsons = string.Empty;
            if (ret)
            {

                jsons = "{success:'true'}";

            }
            else
            {

                jsons = "{success:'false'}";
            }
            Response.Write(jsons);

        }
    }
}